package com.example.kafkademo.consumer;

import com.example.kafkademo.common.MessageEntity;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class SimpleConsumer {

    @KafkaListener(topics = "${kafka.topic.default}", containerFactory = "kafkaListenerContainerFactory")
    public void receive(MessageEntity message){
        System.out.println("收到消息:" + message.toString());
    }
}
